package com.service;
import java.util.List;
import com.model.Jigou;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import com.mapper.JigouMapper;
@Service
public class JigouServiceImpl implements JigouService
{
        
        @Autowired
	private JigouMapper jigouMapper;


	public List<Jigou> queryJigouList(Jigou jigou) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		if(jigou!=null){
			 map.put("fid", jigou.getFid());
		}
		
		List<Jigou> getJigou = jigouMapper.query(map);
		return getJigou;
	}

	public int insertJigou(Jigou jigou) throws Exception {
		
		return jigouMapper.insertJigou(jigou);
	}

	public int deleteJigou(int id) throws Exception {
		return jigouMapper.deleteJigou(id);
	}

	public int updateJigou(Jigou jigou) throws Exception {
		return jigouMapper.updateJigou(jigou);
	}
	
	public Jigou queryJigouById(int id) throws Exception {
		return jigouMapper.queryJigouById(id);
	}
 
}
